package service;

import model.User;

/**
 * @program: pdd
 * @description: JWT 接口类，定义sso服务接口
 * @create: 2020-11-15 13:24
 **/
public interface JwtService {
    /**
     * 登录获取token
     * @param user
     * @return
     */
    public String login(User user) throws Exception;

    /**
     * 更新jwt
     * @param jwt
     * @return
     */
    public String refreshJwt(String jwt);

    /**
     * 生成新的jwt
     * @param name
     * @param role
     * @return
     */
    public String generateNewJwt(String name,String role);

    /**
     * 查jwt是否有效
     * @param jwt
     * @param role
     * @return
     */
    public boolean checkJwt(String jwt,String role);

    /**
     * 无效化当前jwt
     * @param jwt
     */
    public void inValid(String jwt);
}
